# -*- coding: utf-8 -*-

__authur__ = 'Yu XH'


import time
import pickle
import numpy as np

from core.env.train_env import TrainEnv
from examples.demo_agent import DemoAgent
from myAI.my_agent import myAgent


TEAM, CAPTAIN, CODE = 'LGD.DK', '程恺', 'dfd978'  # 18913387965
RED, BLUE, GREEN = 0, 1, -1
scenarios = [2010131194, 2010211129, 2010431153, 2030331196]
for scenario in scenarios:
    agent = myAgent()
    env = TrainEnv(TEAM, CAPTAIN, CODE, scenario)  # instantiate an environment
    print('Environment is ready.')
    agent.setup(scenario, RED)
    file_path = '/wgengine/land_war/myAI/data_in_use/map_' + str(agent.map_id)
    # with open(file_path + '/cost_data.pickle', 'wb') as f:
    #     pickle.dump(agent.map._terrain.cost_data, f)
    # with open(file_path + '/map_col.pickle', 'wb') as f:
    #     pickle.dump(agent.map._terrain.map_col, f)
    # with open(file_path + '/map_row.pickle', 'wb') as f:
    #     pickle.dump(agent.map._terrain.map_row, f)
    # with open(file_path + '/see_data.pickle', 'wb') as f:
    #     pickle.dump(agent.map._terrain.see_data, f)
    with open(file_path + '/map_data.pickle', 'wb') as f:
        map_data = agent.map.get_map_data()
        pickle.dump(map_data, f)